import Request from '@/utils/request'
import type { UserInfo, AuthorityInfo } from '@/types/user'

/**
 * 获取用户信息
 */
export const getUserInfo = (params: any) => {
  return Request.get<UserInfo[]>('/admin/getuser', {
    params
  })
}

/**
 * 修改权限
 */
export const updateAuthorityInfo = (data: AuthorityInfo) => {
  return Request.put<null>('/admin/authority', data)
}

/**
 * 封禁账号
 */
export const lockdown = (id: number) => {
  return Request.put<null>('/admin/lockdown', { id })
}

/**
 * 解封账号
 */
export const unlockdown = (id: number) => {
  return Request.put<null>('/admin/unlockdown', { id })
}
